package bing.web;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

import bing.embedded.tomcat7.EmbededContainer;

/**
 * 测试ParNew回收器（ParNew+Serial Old）：-XX:+UseParNewGC -XX:+PrintGCDetails -Xms30m -Xmx30m
 * 测试Parallel回收器(Parallel+ParallelOld)：-XX:+UseParallelGC -XX:+UseParallelOldGC -XX:ParallelGCThreads=4 -XX:+PrintGCDetails -Xms30m -Xmx30m
 * 测试Serial回收器（Serial+Serial Old）：-XX:+UseSerialGC -XX:+PrintGCDetails -Xms30m -Xmx30m
 * 测试G1回收器：-XX:+UseG1GC -XX:+PrintGCDetails -Xms20m -Xmx20m
 * 
 * @author trs
 *
 */
public class DocumentSearchServer {
	private static String PROJECT_PATH = System.getProperty("user.dir");  
	private static String CATALINA_HOME_PATH = PROJECT_PATH + "/appserver/tomcat";
    private static String WEB_APP_PATH = CATALINA_HOME_PATH + File.separatorChar + "webapps/";  
    
	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub
		EmbededContainer serverContainer=new EmbededContainer(CATALINA_HOME_PATH);
		
		Map<String, String> contexts = new HashMap<String, String>();
		contexts.put("/demo", WEB_APP_PATH+"demo");
		//contexts.put("/test", WEB_APP_PATH+"test");
		//contexts.put("", "ROOT");
		
		serverContainer.setConexts(contexts);
		
		//设置默认connector的端口
		serverContainer.setDefaultConnectorPort(9000);
		
		serverContainer.startup();
		
	}

}
